<?php
/**
 * Object Relational Persistence Mapping Class for table: icd10_chapter
 *
 * @package	com.athena
 * @author	LHV
 */
class Icd10Chapter extends ORDataObject {

	/**#@+
	 * Fields of table: icd10_chapter mapped to class members
	 */
	var $icd10_chapter_id		= '';
	var $vi_name	=	'';
	var $en_name	=	'';
	var $code		= '';
	/**#@-*/


	/**
	 * DB Table
	 */
	var $_table = 'icd10_chapter';

	/**
	 * Primary Key
	 */
	var $_key = 'icd10_chapter_id';
	
	/**
	 * Internal Name
	 */
	var $_internalName = 'Icd10Chapter';

	/**
	 * Handle instantiation
	 */
	function __construct() {
		parent::ORDataObject();
	}
	public function listAllChapters() {
		$field        =   L10nHelper::getLocale();
		$field		=	L10nHelper::changeField($field, "name");
		$ds       =   new Datasource_sql();
        $sql    =   array(
            'cols'      =>  "icd10_chapter_id, code, $field name",
            'from'      =>  "$this->_table" ,
            'orderby'   =>  "icd10_chapter_id"
        );  
        $ds->setup($this->_db,$sql);
        $res    =   $ds->toArray();
        return $res;
	}

	
}
?>
